import fetch from '@/utils/fetch'

export function addDashboard(data) {
  return fetch({
    url: '/bi/biDashboard/add',
    method: 'POST',
    data
  })
}

export function updateDashboard(data) {
  return fetch({
    url: '/bi/biDashboard/edit',
    method: 'PUT',
    data
  })
}

export function getdDashboardById(params) {
  return fetch({
    url: '/bi/biDashboard/queryById',
    method: 'GET',
    params
  })
}

export function deleteDashboard(params) {
  return fetch({
    url: `/bi/biDashboard/delete`,
    method: 'delete',
    params
  })
}

export function dashboardList() {
  return fetch({
    //url: `/bi/biDashboard/list`
    url:'/bi/biDashboard/allList'
  })
}

export function addChartToDB(params) {
  return fetch({
    url: '/bi/biChart/addBoard',
    method: 'GET',
    params
  })
}

//获取当前看板图表内容
export function queryChartByBoardId(params) {
  return fetch({
    url: '/bi/biChart/queryChartByBoardId',
    method: 'get',
    params
  })
}
//获取当前看板图表内容 end

export function dbByChart(params) {
  return fetch({
    url: '/bi/biDashboard/queryBoardByChartId',
    method: 'get',
    params
  })
}

//删除看板中某个图表
export function unMapChartDb(params) {
  return fetch({
    url: '/bi/biChartboardmap/deleteMap',
    method: 'DELETE',
    params
  })
}

export function dbOrder(data) {
  return fetch({
    url: '/dashboard/order',
    method: 'POST',
    data
  })
}


